<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<meta charset="utf-8" />
		<title>青芒果后台管理平台</title>

		<meta name="description" content="overview &amp; stats" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

		<!-- bootstrap & fontawesome -->
		<link rel="stylesheet" href="/public/assets/css/bootstrap.min.css" />
		<link rel="stylesheet" href="/public/assets/css/font-awesome.min.css" />

		<!-- page specific plugin styles -->

		<!-- text fonts -->
		<link rel="stylesheet" href="/public/assets/css/ace-fonts.css" />

		<!-- ace styles -->
		<link rel="stylesheet" href="/public/assets/css/ace.min.css" id="main-ace-style" />

		<!--[if lte IE 9]>
			<link rel="stylesheet" href="/public/assets/css/ace-part2.min.css" />
		<![endif]-->
		<link rel="stylesheet" href="/public/assets/css/ace-skins.min.css" />
		<link rel="stylesheet" href="/public/assets/css/ace-rtl.min.css" />
		
		<link rel="stylesheet" href="/public/assets/css/jquery.gritter.css" />

		<!--[if lte IE 9]>
		  <link rel="stylesheet" href="/public/assets/css/ace-ie.min.css" />
		<![endif]-->

		<!-- inline styles related to this page -->

		<!-- ace settings handler -->
		<script src="/public/assets/js/ace-extra.min.js"></script>

		<!-- HTML5shiv and Respond.js for IE8 to support HTML5 elements and media queries -->

		<!--[if lte IE 8]>
		<script src="/public/assets/js/html5shiv.min.js"></script>
		<script src="/public/assets/js/respond.min.js"></script>
		<![endif]-->
		
		<!--[if !IE]> -->
		<script type="text/javascript">
			window.jQuery || document.write("<script src='/public/assets/js/jquery.min.js'>"+"<"+"/script>");
		</script>
		<!-- <![endif]-->
		<script type="text/javascript">
			if('ontouchstart' in document.documentElement) document.write("<script src='/public/assets/js/jquery.mobile.custom.min.js'>"+"<"+"/script>");
		</script>
		<script src="/public/assets/js/bootstrap.min.js"></script>
	</head>

	<body class="<?=isset($_COOKIE['ace_skin'])&&$_COOKIE['ace_skin']?$_COOKIE['ace_skin']:'no-skin'?>">
		<!-- #section:basics/navbar.layout -->
		<div id="navbar" class="navbar navbar-default">
			<script type="text/javascript">
				try{ace.settings.check('navbar' , 'fixed')}catch(e){}
			</script>

			<div class="navbar-container" id="navbar-container">
				<!-- #section:basics/sidebar.mobile.toggle -->
				<button type="button" class="navbar-toggle menu-toggler pull-left" id="menu-toggler">
					<span class="sr-only">Toggle sidebar</span>

					<span class="icon-bar"></span>

					<span class="icon-bar"></span>

					<span class="icon-bar"></span>
				</button>

				<!-- /section:basics/sidebar.mobile.toggle -->
				<div class="navbar-header pull-left">
					<!-- #section:basics/navbar.layout.brand -->
					<a href="#" class="navbar-brand"><small><i class="fa fa-leaf"></i>青芒果后台管理平台</small></a>

					<!-- /section:basics/navbar.layout.brand -->

					<!-- #section:basics/navbar.toggle -->

					<!-- /section:basics/navbar.toggle -->
				</div>

				<!-- #section:basics/navbar.dropdown -->
				<div class="navbar-buttons navbar-header pull-right" role="navigation">
					<ul class="nav ace-nav">
						<!-- #section:basics/navbar.user_menu -->
						<li class="light-blue">
							<a data-toggle="dropdown" href="#" class="dropdown-toggle">
								<img class="nav-user-photo" src="/public/assets/avatars/user.jpg" alt="Jason's Photo" />
								<span class="user-info"><small>欢迎回来</small>
									<?if(isset($_COOKIE['qingMg_admininfo'])){
										$qingMg_admininfo=acl::getCookie('qingMg_admininfo');
										echo $qingMg_admininfo['username'];
									}?>
								</span>
								<i class="ace-icon fa fa-caret-down"></i>
							</a>

							<ul class="user-menu dropdown-menu-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
								<li><a href="<?=$this->url('entry/index')?>"><i class="ace-icon fa fa-home"></i>首页</a></li>
								<li><a href="javascript:;" onclick="upPwd()"><i class="ace-icon fa fa-user"></i>密码修改</a></li>
								<li class="divider"></li>
								<li><a href="javascript:;" onclick="logOut()"><i class="ace-icon fa fa-power-off"></i>退出</a></li>
							</ul>
						</li>

						<!-- /section:basics/navbar.user_menu -->
					</ul>
				</div>

				<!-- /section:basics/navbar.dropdown -->
			</div><!-- /.navbar-container -->
		</div>

		<!-- /section:basics/navbar.layout -->
		<div class="main-container" id="main-container">
			<script type="text/javascript">
				try{ace.settings.check('main-container' , 'fixed')}catch(e){}
			</script>

			<!-- #section:basics/sidebar -->
			<div id="sidebar" class="sidebar responsive">
				<script type="text/javascript">
					try{ace.settings.check('sidebar' , 'fixed')}catch(e){}
				</script>
				
				<ul class="nav nav-list">
				<?
				if($this->adminMenu){
					foreach($this->adminMenu as $k=>$v){
						if(!$v['isaction']&&$v['status']){?>
							<li class="<?if(stripos($_SERVER['PHP_SELF'],'/'.$v['url'])){echo 'active';}?>">
								<a href="<?if($v['children']){echo '#';}else{echo $this->url($v['url']);}?>" <?=$v['children']?'class="dropdown-toggle"':''?>>
									<i class="menu-icon fa <?=$v['icon']?>"></i>
									<span class="menu-text"> <?=$v['title']?> </span>
									<?=$v['children']?'<b class="arrow fa fa-angle-down"></b>':''?>
								</a>
								<b class="arrow"></b>
							<?if($v['children']){?>
								<ul class="submenu">
								<?foreach($v['children'] as $ka=>$va){
									if(!$va['isaction']&&$va['status']){?>
										<li class="<?if(stripos($_SERVER['PHP_SELF'],$va['url'])){echo 'active';}?>">
											<a href="<?=$this->url($va['url'])?>">
												<i class="menu-icon fa fa-caret-right"></i>
												<?=$va['title']?>
											</a>
											<b class="arrow fa fa-angle-down"></b>
										</li>
									<?}?>
								<?}?>
								</ul>
							<?}?>
							</li>
						<?}?>
					<?}
				}
				?>
				</ul>
				
				<!-- #section:basics/sidebar.layout.minimize -->
				<div class="sidebar-toggle sidebar-collapse" id="sidebar-collapse">
					<i class="ace-icon fa fa-angle-double-left" data-icon1="ace-icon fa fa-angle-double-left" data-icon2="ace-icon fa fa-angle-double-right"></i>
				</div>

				<!-- /section:basics/sidebar.layout.minimize -->
				<script type="text/javascript">
					try{ace.settings.check('sidebar' , 'collapsed')}catch(e){}
				</script>
			</div>
			
			<? include $this->loadView();?>
			
			<div class="footer">
				<div class="footer-inner">
					<!-- #section:basics/footer -->
					<div class="footer-content">
						<span class="bigger-100 blue">
							技术支持：成都混沌数据处理有限公司&nbsp;&nbsp;CopyRight © 2015 蜀ICP备15004985号&nbsp;&nbsp;All Rights Reserved
						</span>
					</div>

					<!-- /section:basics/footer -->
				</div>
			</div>

			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->
		
		<div class="bootbox modal fade bootbox-prompt in" tabindex="-1" role="dialog" aria-hidden="false" id="upPwd" style="position:absolute;left:100%;display:block;">
			<div style="background-color: #303030;filter:alpha(opacity=70);-moz-opacity:0.7;-khtml-opacity: 0.7;opacity: 0.7;position: fixed;width: 100%;height: 100%;"></div>
			<div class="modal-dialog">
				<div class="modal-content">
					<div class="modal-header">
						<button type="button" class="bootbox-close-button close" data-dismiss="modal" aria-hidden="true" onclick="animateColse('#upPwd')">×</button>
						<h4 class="modal-title">密码修改</h4>
					</div>
					<form class="bootbox-form">
						<div class="modal-body">
							<div class="bootbox-body">
								<input class="form-control" type="password" name="password" placeholder="新密码" data-rel="tooltip" title="新密码">
								<input class="form-control" type="password" name="pwd" placeholder="确认密码" data-rel="tooltip" title="确认密码" style="margin-top:10px;">
							</div>
						</div>
						<div class="modal-footer">
							<button type="button" class="btn btn-default" onclick="animateColse('#upPwd')">取消</button>
							<button type="button" class="btn btn-primary">提交</button>
						</div>
					</form>
				</div>
			</div>
		</div>
		
		<!-- basic scripts -->
		
		<!--[if IE]>
		<script type="text/javascript">
			window.jQuery || document.write("<script src='/public/assets/js/jquery1x.min.js'>"+"<"+"/script>");
		</script>
		<![endif]-->

		<!-- page specific plugin scripts -->

		<!--[if lte IE 8]>
			<script src="/public/assets/js/excanvas.min.js"></script>
		<![endif]-->
		<script src="/public/assets/js/jquery-ui.custom.min.js"></script>
		<script src="/public/assets/js/jquery.ui.touch-punch.min.js"></script>
		<script src="/public/assets/js/jquery.easypiechart.min.js"></script>
		<script src="/public/assets/js/jquery.sparkline.min.js"></script>
		<script src="/public/assets/js/flot/jquery.flot.min.js"></script>
		<script src="/public/assets/js/flot/jquery.flot.pie.min.js"></script>
		<script src="/public/assets/js/flot/jquery.flot.resize.min.js"></script>

		<!-- ace scripts -->
		<script src="/public/assets/js/ace-elements.min.js"></script>
		<script src="/public/assets/js/ace.min.js"></script>

		<!-- the following scripts are used in demo only for onpage help and you don't need them -->
		<link rel="stylesheet" href="/public/assets/css/ace.onpage-help.css" />
		<link rel="stylesheet" href="/public/docs/assets/js/themes/sunburst.css" />

		<script type="text/javascript"> ace.vars['base'] = '..'; </script>
		<script src="/public/assets/js/ace/elements.onpage-help.js"></script>
		<script src="/public/assets/js/ace/ace.onpage-help.js"></script>
		<script src="/public/docs/assets/js/rainbow.js"></script>
		<script src="/public/docs/assets/js/language/generic.js"></script>
		<script src="/public/docs/assets/js/language/html.js"></script>
		<script src="/public/docs/assets/js/language/css.js"></script>
		<script src="/public/docs/assets/js/language/javascript.js"></script>
		<script src="/public/assets/js/jquery.gritter.min.js"></script>
		<script src="/public/assets/js/bootbox.min.js"></script>
		
		<script>
			$('#pageGet').click(function(){window.location.href=$('#goToPage').attr('lang')+'page='+$('#goToPage').val();});
			function logOut(){
				$.ajax({
					type:'POST',
					url:'<?=$this->url("common/logout")?>',
					data:'',
					dataType:'json',
					success:function(r){
						if(r.state==1){
							window.location.href=r.url;
						}else{
							gritter("gritter-error gritter-light",3000,"操作提示",r.html);
						}
					},
					error:function(){
						gritter("gritter-error gritter-light",3000,"操作提示","网络错误！请联系我方工作人员。");
					}
				});
			}
			function upPwd(){$('#upPwd').animate({left:"0"});}
			$('#upPwd button.btn-primary').click(function(){
				$.ajax({
					type:'POST',
					url:'<?=$this->url("system/upPwd")?>',
					data:$('#upPwd form').serialize(),
					dataType:'json',
					success:function(r){
						if(r.state==1){
							gritter("gritter-success gritter-light",3000,"操作提示",r.html);
							setTimeout('window.location.href="'+r.url+'"',3000);
						}else{
							gritter("gritter-error gritter-light",3000,"操作提示",r.html);
						}
					},
					error:function(){
						gritter("gritter-error gritter-light",3000,"操作提示","网络错误！请联系我方工作人员。");
					}
				});
			})
			function gritter(class_name,time,title,text){
				$.gritter.add({
					class_name: class_name,
					time: time,
					title: title,
					text: text
				});
			}
			$('[data-rel=tooltip]').tooltip({container:'body'});
			function animateColse(obj){$(obj).animate({left:"100%"});}
		</script>
		
		<!-- js cookie --><!--
		<script src="/public/assets/js/jquery.cookie.js"></script>
		<script>
			function skin(){
				var date = new Date();date.setTime(date.getTime() + (365*1000*60*60*24));
				$('body').attr('class',$.cookie('body_skin'));$.cookie('body_skin', '', { expires: -date });
			}skin();
			$('#skin-colorpicker').change(function(){
				//$.cookie('the_cookie', 'the_value', {expires: 365, path: '/', secure: true});
				var body_skin_cookie=$('#skin-colorpicker option[value='+$(this).val()+']').attr('data-skin');
				var date = new Date();date.setTime(date.getTime() + (365*1000*60*60*24));
				$.cookie('body_skin',body_skin_cookie,{expires: date, path: '/'});
			});
		</script>
		-->
	</body>
</html>
